home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / TemplateMF / MakeDLL next >
Text File  |  1995-07-08  |  3KB  |  126 lines

  1.  
  2.  
  3. # Template makefile to make Straylight Dynamic Link 
  4. # Library from a DeskLib sublibrary's .o files
  5. #
  6. # The DLL is made in the directory 
  7. # '<DeskLib$Dir>.!DLLs.Freeware_1.DeskLib.'
  8. # and has the same name as the DeskLib sublibrary.
  9. #
  10. # Julian Smith 17 Apr 1995.
  11.  
  12. # The macro $(ObjectFiles) should be set at the 
  13. # start of this file, to be a space-separated
  14. # list of object files.
  15. # This is done by 'Makatic'.
  16.  
  17. # The macro $(LibName) should also be set at the 
  18. # start of this file, to be the name of the 
  19. # DeskLib sublibrary.
  20. # This is done by 'Makatic'.
  21.  
  22. # Note that this makefile doesn't use cc at all
  23. # - it merely links existing .o files.
  24.  
  25. # Linker flags, These can be anything. 
  26. # All flags required by Straylight (eg Link -rmf) 
  27. # are included in the $(LINK) macro.
  28. #
  29. LinkFlags    =    $(LinkExtra)
  30.  
  31.  
  32. # Macros for commands, including the Straylight
  33. # tool 'cdll'. Note that DRLink doesn't seem to
  34. # work with the SDLS.
  35. #
  36. LINK        =    Link -rmf
  37. CDLL        =    cdll
  38.  
  39.  
  40. # Filename of the thing we need to make: - the main
  41. # dynamically-linked library, which will go in the 
  42. # !DLL application.
  43. # NB The leafname of $(DLL_Lib) file (after copying into the !DLL
  44. # application) should be the same as the 'name' field in the
  45. # $(DLL_Def) file. In this case, this is $(LibName).
  46. DLL_Lib        =    <DeskLib$Dir>.!DLLs.Freeware_1.DeskLib.$(LibName)
  47.  
  48.  
  49. # Filenames of intermediate files needed to make $(DLL_Lib) and $(DLL_Stubs).
  50. #
  51. DLL_Header    =    Header
  52. DLL_Def        =    ^.DLLDef
  53. DLL_Stubs    =    Stubs
  54.  
  55.  
  56.  
  57. # -------------------------------------------------------
  58. # Everything below here should probably not be changed...
  59. # -------------------------------------------------------
  60.  
  61.  
  62. # Extra libs, written by Straylight, which always need to be linked into a DLL
  63. #
  64. SDLS_ExtraObjects=                    \
  65.             C:DLLLib.o.DLLLib        \
  66.             C:DLLLib.o.dstubs        \
  67.  
  68.  
  69. # Extra DeskLib libraries which need to be linked into the final DLL.
  70. # The DLL DeskLib library is included here because some DeskLib DLLs may
  71. # refer to other DeskLib DLLs.
  72. # Note that DeskLib:o.DLL contains all the DLL.o.* files except for 
  73. # the sublibraries for which there is a DLL - just the DLL Stubs file
  74. # is included for these.
  75. #
  76. DeskLib_ExtraObjects=                \
  77.             DeskLib:o.DLLDLL    \
  78.  
  79.  
  80.  
  81.  
  82. #Here's what we want to make...
  83.  
  84. All:    $(DLL_Lib)
  85.  
  86. $(DLL_Lib):    $(DeskLib_ExtraObjects) $(SDLS_ExtraObjects) $(DLL_Header) $(ObjectFiles)
  87.     $(LINK) $(LinkFlags) -o $@ $(ObjectFiles) $(DeskLib_ExtraObjects) $(SDLS_ExtraObjects) $(DLL_Header)
  88.  
  89.  
  90.  
  91. # Here's how to make the things which are needed in the above rules
  92.  
  93. $(DLL_Def):    
  94.     | Error: No DLL definition file exists.
  95.     |        You should run th MkStubsOs makefile
  96.     |        and then alter the template Def
  97.     |        file by hand.
  98.  
  99. $(DLL_Header):    $(DLL_Def)
  100.     $(CDLL) -def $(DLL_Def) -hdr $(DLL_Header)
  101.  
  102.  
  103. # Rule for compiling C source code for a Straylight dynamically-linked library.
  104. # Actually, we don't call cc - we complain and tell the user to run the 
  105. # MkStubsOs makefile.
  106.  
  107. VPATH = @.^
  108.  
  109. .SUFFIXES:    .o .c .s
  110. .c.o:
  111.     | $@ needs recompiling. This should be done by
  112.     | running the MkStubsOs or MkOs makefile before running
  113.     | this makefile.
  114.     |
  115.  
  116. .s.o:
  117.     | $@ needs assembling. This should be done by
  118.     | running the MkStubsOs or MkOs makefile before running
  119.     | this makefile.
  120.     |
  121.  
  122.  
  123.  
  124. # Dynamic dependencies:
  125.